<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>TranscriberInterfaceTest</title>

<link rel="stylesheet"
	href="http://code.jquery.com/qunit/qunit-1.15.0.css">
<script src="http://code.jquery.com/qunit/qunit-1.15.0.js"></script>

<script src="../../main/js/util/Logger.js"></script>

<script src="../../main/js/AngloSaxonRune.js"></script>
<script src="../../main/js/AngloSaxonRuneFormat.js"></script>
<script src="../../main/js/EnglishAngloSaxonTranscriber.js"></script>

<script src="../../main/js/AurebeshRune.js"></script>
<script src="../../main/js/AurebeshRuneFormat.js"></script>
<script src="../../main/js/EnglishAurebeshTranscriber.js"></script>

<script src="../../main/js/CerthRune.js"></script>
<script src="../../main/js/CerthRuneFormat.js"></script>
<script src="../../main/js/EnglishCirthEreborTranscriber.js"></script>

<script src="../../main/js/EnglishTengwarTranscriber.js"></script>
<script src="../../main/js/TengwaRune.js"></script>
<script src="../../main/js/TengwaRuneFormat.js"></script>

<script>
    var LOGGER = new Logger();

    QUnit.test("Transcriber interface", function(assert)
    {
        // Setup.
        var transcriber0 = new EnglishAngloSaxonTranscriber();
        var transcriber1 = new EnglishAurebeshTranscriber();
        var transcriber2 = new EnglishCirthEreborTranscriber();
        var transcriber3 = new EnglishTengwarTranscriber();
        var transcribers = [ transcriber0, transcriber1, transcriber2,
                transcriber3 ];

        // Run / Verify.
        for (var i = 0; i < transcribers.length; i++)
        {
            var transcriber = transcribers[i];

            // Verify the functions exist.
            assert.ok(transcriber.getFormatter, (typeof transcriber)
                    + ".getFormatter");
            assert.ok(transcriber.getForwardMap, (typeof transcriber)
                    + ".getForwardMap");
            assert.ok(transcriber.getMaxForwardKeyLength, (typeof transcriber)
                    + ".getMaxForwardKeyLength");
            assert.ok(transcriber.getMaxReverseKeyLength, (typeof transcriber)
                    + ".getMaxReverseKeyLength");
            assert.ok(transcriber.getReverseMap, (typeof transcriber)
                    + ".getReverseMap");
            assert.ok(transcriber.transcribeForward, (typeof transcriber)
                    + ".transcribeForward");
            assert.ok(transcriber.transcribeReverse, (typeof transcriber)
                    + ".transcribeReverse");
        }
    });
</script>
</head>
<body>
	<div id="qunit"></div>
</body>
</html>
